package com.youshang520i.controller;

import com.support.annotation.*;
import com.youshang520i.model.SystemUser;
import com.youshang520i.thread.SystemUserThreadLocal;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author youshang
 */
@RestController
@RequestMapping("/token")
public class ParsingTokenController {

    @GetMapping("/index")
    public String index(@SystemUserAnnotation SystemUser systemUser, @UserAnnotation SystemUser user) {

        systemUser.setUserId("admin1");
        user.setUserId("admin2");


        System.out.println(SystemUserThreadLocal.get());


        System.out.println("SystemUserAnnotation -> " + systemUser);
        System.out.println("UserAnnotation -> " + user);
        return "parsing token index!!!";
    }

}
